/*! \file VertexFormat.h
 *	\brief <write description for VertexFormat.h>
 *
 *	created:	2009/11/24
 *	created:	24:11:2009   17:37
 *	filename: 	o:\gag-engine\libs\gd\VertexFormat.h
 *	file path:	o:\gag-engine\libs\gd
 *	file base:	VertexFormat
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _GD_VERTEXFORMAT_H_
#define _GD_VERTEXFORMAT_H_

#pragma once

namespace tt{
namespace gd{

class VertexFormat
{
public:
	VertexFormat();

	VertexFormat& addPosition();
	bool hasPosition() const;

	VertexFormat& addNormal();
	bool hasNormal() const;

	VertexFormat& addColor();
	bool hasColor() const;

	UInt vertexSize() const;
	UInt positionOffset() const;
	UInt normalOffset() const;
	UInt colorOffset() const;

private:
	void addFlag(UInt flag);
	bool hasFlag(UInt flag) const;

private:
	enum Flags
	{
		F_POSITION	= 1 << 0,
		F_NORMAL	= 1 << 1,
		F_COLOR		= 1 << 2,
		F_TEXTURE0	= 1 << 3,
	};
	UInt m_vertexFormat;
};

} //namespace gd
} //namespace tt
#include "VertexFormat.inl"

#endif //_GD_VERTEXFORMAT_H_